package com.tcl.launcherpro.lock.demo;

import android.app.Application;
import android.view.ViewGroup;

import com.hawk.android.adsdk.ads.HkMobileAds;
import com.tcl.ad.LockAdNativeAdManager;
import com.tcl.launcherpro.lockscreen.ad.ILockAdProxy;
import com.tcl.launcherpro.lockscreen.ad.LockAdManagerImpl;

/**
 * <br>类描述:
 * <br>详细描述:
 * <br><b>Author sichard</b>
 * <br><b>Date 2017/4/19</b>
 */

public class LockApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        HkMobileAds.initialize(this, "6eea17deb487472394c896657eb755e1", "1bf1a3f0ab7346d68d2152c53e593e49");
                HkMobileAds.openLog();
        LockAdNativeAdManager.init(this, "1bf1a3f0ab7346d68d2152c53e593e49");
        LockAdManagerImpl.getInstance().setProxy(new ILockAdProxy() {
            @Override
            public void loadAD() {
                LockAdNativeAdManager.getInstance().loadAd();
            }

            @Override
            public void setContainer(ViewGroup v) {
                LockAdNativeAdManager.getInstance().setContainer(v);
            }

            @Override
            public boolean hasView() {
                return LockAdNativeAdManager.getInstance().hasView();
            }

            @Override
            public void showAdView(ViewGroup v) {
                LockAdNativeAdManager.getInstance().showAdView(v);
            }
        });
        LockAdNativeAdManager.getInstance().loadAd();
    }
}
